<?php $this->pageTitle=Yii::app()->name . ' - Mettre à jour mes informations personnelles';?>

<h1>Mettre à jour mes informations personnelles</h1>

<div class="form">
	<?php $form=$this->beginWidget('UActiveForm', array(
		'id'=>'profile-form',
		'enableAjaxValidation'=>true,
		'htmlOptions' => array('enctype'=>'multipart/form-data'),
	)); ?>

	<?php echo $form->errorSummary(array($model,$client)); ?>
	
	<table class="table_form_registration">
		<?php echo $form->hiddenField($client,'valid',array('value'=>'1','size'=>1,'maxlength'=>1)); ?>
	<?php echo $form->hiddenField($client,'id_user',array('value'=>Yii::app()->user->id,'size'=>1,'maxlength'=>1)); ?>
	<table class="table_form_registration">
		<tr>
			<td class="libelle_form_registration"><?php echo $form->labelEx($client,'civilite'); ?></td>
			<td class="separateur">:</td>
			<td class="champ_form_registration"><table class="champs_civilite"><tr><td><?php echo $form->radioButtonList($client,'civilite',array('M.'=>'M.','Mme'=>'Mme','Mlle'=>'Mlle'),array('separator'=>'</td><td>')); ?></td></tr></table></td>
			<td class="erreur_form_registration"><?php echo $form->error($client,'civilite'); ?></td>
		</tr>
		<tr>
			<td class="libelle_form_registration"><?php echo $form->labelEx($client,'nom'); ?></td>
			<td class="separateur">:</td>
			<td class="champ_form_registration"><?php echo $form->textField($client,'nom',array('size'=>32,'maxlength'=>32)); ?></td>
			<td class="erreur_form_registration"><?php echo $form->error($client,'nom'); ?></td>
		</tr>
		<tr>
			<td class="libelle_form_registration"><?php echo $form->labelEx($client,'prenom'); ?></td>
			<td class="separateur">:</td>
			<td class="champ_form_registration"><?php echo $form->textField($client,'prenom',array('size'=>32,'maxlength'=>32)); ?></td>
			<td class="erreur_form_registration"><?php echo $form->error($client,'prenom'); ?></td>
		</tr>
		<tr>
			<td class="libelle_form_registration"><?php echo $form->labelEx($client,'dateDeNaissance'); ?></td>
			<td class="separateur">:</td>
			<td class="champ_form_registration"><?php echo $form->textField($client,'dateDeNaissance',array('size'=>10,'maxlength'=>10)); ?> <span class="libelleFormatDate">(Format : JJ/MM/AAAA)</span></td>
			<td class="erreur_form_registration"><?php echo $form->error($client,'dateDeNaissance'); ?></td>
		</tr>
		<tr>
			<td class="libelle_form_registration" valign="top"><?php echo $form->labelEx($client,'adresse'); ?></td>
			<td class="separateur" valign=top>:</td>
			<td class="champ_form_registration"><?php echo $form->textarea($client,'adresse',array('size'=>60,'maxlength'=>500)); ?></td>
			<td class="erreur_form_registration"><?php echo $form->error($client,'adresse'); ?></td>
		</tr>
		<tr>
			<td class="libelle_form_registration"><?php echo $form->labelEx($client,'codePostal'); ?></td>
			<td class="separateur">:</td>
			<td class="champ_form_registration"><?php echo $form->textField($client,'codePostal',array('size'=>5,'maxlength'=>5)); ?></td>
			<td class="erreur_form_registration"><?php echo $form->error($client,'codePostal'); ?></td>
		</tr>
		<tr>
			<td class="libelle_form_registration"><?php echo $form->labelEx($client,'ville'); ?></td>
			<td class="separateur">:</td>
			<td class="champ_form_registration">
				<?php 
				$this->widget('zii.widgets.jui.CJuiAutoComplete',
					array(
						//name of the html field that will be generated
						'name'=>CHtml::activeName($client,'ville'),
						'value'=>$client->ville,
						'source'=>$this->createUrl('/client/autocompleteVille'),
						'options'=>array(
					        'minLength'=>'2',
					    ), 
					    'htmlOptions'=> array(
					    	'size'=>'32',
					    	'class'=> $classErreurVille,
					    ),
					));
			    ?>
			</td>
			<td class="erreur_form_registration"><?php echo $form->error($client,'ville'); ?></td>
		</tr>
		<tr>
			<td class="libelle_form_registration"><?php echo $form->labelEx($client,'pays'); ?></td>
			<td class="separateur">:</td>
			<td class="champ_form_registration"><?php echo $form->dropDownList($client,'pays',CHtml::listData($listePays, 'nom', 'nom')); ?></td>
			<td class="erreur_form_registration"><?php echo $form->error($client,'pays'); ?></td>
		</tr>
		<tr>
			<td class="libelle_form_registration"><?php echo $form->labelEx($client,'tel'); ?></td>	
			<td class="separateur">:</td>
			<td class="champ_form_registration"><?php echo $form->textField($client,'tel',array('size'=>20,'maxlength'=>20)); ?></td>
			<td class="erreur_form_registration"><?php echo $form->error($client,'tel'); ?></td>
		</tr>
		
		<tr>
			<td class="libelle_form_registration"><?php echo $form->labelEx($model,'username'); ?></td>
			<td class="separateur">:</td>
			<td class="champ_form_registration"><?php echo $form->textField($model,'username'); ?></td>
			<td class="erreur_form_registration" id="erreurUserNameFormRegistration"><?php echo $form->error($model,'username'); ?></td>
		</tr>
		<tr>
			<td class="libelle_form_registration"><?php echo $form->labelEx($model,'email'); ?></td>
			<td class="separateur">:</td>
			<td class="champ_form_registration"><?php echo $form->textField($model,'email'); ?></td>
			<td class="erreur_form_registration" id="erreurMailFormRegistration"><?php echo $form->error($model,'email'); ?></td>
		</tr>
		<tr>
			<td class="libelle_form_registration"><?php echo $form->labelEx($model,'urlImage'); ?></td>
			<td class="separateur">:</td>
			<td class="champ_form_registration"><?php echo $form->FileField($model,'urlImage',array('size'=>30,'maxlength'=>300)); ?></td>
			<td class="erreur_form_registration" id="erreurUrlImageFormProduit"><?php echo $form->error($model,'urlImage'); ?></td>
		</tr>
		
		<tr>
			<td class="bouton_form_registration" colspan=4>
				<table>
					<tr>
						<td><?php echo Chtml::link(CHtml::button("Retour"),$this->createUrl("/client/profil")) ?></td>
						<td><?php echo CHtml::submitButton("Suivant"); ?></td>
					</tr>
				</table>
			</td>
		</tr>
	</table>

<?php $this->endWidget(); ?>

</div><!-- form -->
